#include <stdio.h>

int main() {
    int n = 0;
    int arr[51] = {0};
    scanf("%d", &n);
    int i = 0;
    for(i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
    }
    int dele = 0;
    scanf("%d", &dele);

    for(i = 0; i < n; i++)
    {
        if(arr[i] == dele)
        {
            continue;
        }
        printf("%d ", arr[i]);
    }
    return 0;
}
